package com.paobuji.aidebao.myapplication.bean;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.List;

/**
 * Created by lenovo on 2017/3/13.
 */

public class GetAllQuestion implements Parcelable {

    /**
     * code : 0
     * msg : 成功
     * data : {"extra":{"totalSize":5,"size":8,"totalPage":1,"page":0},"questionlist":[{"quesAnswer":"????","quesTitle":"????","countUseful":0,"id":5,"quesType":"????"},{"quesAnswer":"????","quesTitle":"????","countUseful":0,"id":4,"quesType":"????"},{"quesAnswer":"????","quesTitle":"????","countUseful":0,"id":3,"quesType":"????"},{"quesAnswer":"????","quesTitle":"????","countUseful":0,"id":2,"quesType":"????"},{"quesAnswer":"????","quesTitle":"????","countUseful":0,"id":1,"quesType":"????"}]}
     */

    private int code;
    private String msg;
    /**
     * extra : {"totalSize":5,"size":8,"totalPage":1,"page":0}
     * questionlist : [{"quesAnswer":"????","quesTitle":"????","countUseful":0,"id":5,"quesType":"????"},{"quesAnswer":"????","quesTitle":"????","countUseful":0,"id":4,"quesType":"????"},{"quesAnswer":"????","quesTitle":"????","countUseful":0,"id":3,"quesType":"????"},{"quesAnswer":"????","quesTitle":"????","countUseful":0,"id":2,"quesType":"????"},{"quesAnswer":"????","quesTitle":"????","countUseful":0,"id":1,"quesType":"????"}]
     */

    private DataBean data;

    protected GetAllQuestion(Parcel in) {
        code = in.readInt();
        msg = in.readString();
    }

    public static final Creator<GetAllQuestion> CREATOR = new Creator<GetAllQuestion>() {
        @Override
        public GetAllQuestion createFromParcel(Parcel in) {
            return new GetAllQuestion(in);
        }

        @Override
        public GetAllQuestion[] newArray(int size) {
            return new GetAllQuestion[size];
        }
    };

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public DataBean getData() {
        return data;
    }

    public void setData(DataBean data) {
        this.data = data;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel parcel, int i) {
        parcel.writeInt(code);
        parcel.writeString(msg);
    }

    public static class DataBean implements Parcelable {
        /**
         * totalSize : 5
         * size : 8
         * totalPage : 1
         * page : 0
         */

        private ExtraBean extra;
        /**
         * quesAnswer : ????
         * quesTitle : ????
         * countUseful : 0
         * id : 5
         * quesType : ????
         */

        private List<QuestionlistBean> questionlist;

        protected DataBean(Parcel in) {
        }

        public static final Creator<DataBean> CREATOR = new Creator<DataBean>() {
            @Override
            public DataBean createFromParcel(Parcel in) {
                return new DataBean(in);
            }

            @Override
            public DataBean[] newArray(int size) {
                return new DataBean[size];
            }
        };

        public ExtraBean getExtra() {
            return extra;
        }

        public void setExtra(ExtraBean extra) {
            this.extra = extra;
        }

        public List<QuestionlistBean> getQuestionlist() {
            return questionlist;
        }

        public void setQuestionlist(List<QuestionlistBean> questionlist) {
            this.questionlist = questionlist;
        }

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel parcel, int i) {
        }

        public static class ExtraBean implements Parcelable {
            private int totalSize;
            private int size;
            private int totalPage;
            private int page;

            protected ExtraBean(Parcel in) {
                totalSize = in.readInt();
                size = in.readInt();
                totalPage = in.readInt();
                page = in.readInt();
            }

            public static final Creator<ExtraBean> CREATOR = new Creator<ExtraBean>() {
                @Override
                public ExtraBean createFromParcel(Parcel in) {
                    return new ExtraBean(in);
                }

                @Override
                public ExtraBean[] newArray(int size) {
                    return new ExtraBean[size];
                }
            };

            public int getTotalSize() {
                return totalSize;
            }

            public void setTotalSize(int totalSize) {
                this.totalSize = totalSize;
            }

            public int getSize() {
                return size;
            }

            public void setSize(int size) {
                this.size = size;
            }

            public int getTotalPage() {
                return totalPage;
            }

            public void setTotalPage(int totalPage) {
                this.totalPage = totalPage;
            }

            public int getPage() {
                return page;
            }

            public void setPage(int page) {
                this.page = page;
            }

            @Override
            public int describeContents() {
                return 0;
            }

            @Override
            public void writeToParcel(Parcel parcel, int i) {
                parcel.writeInt(totalSize);
                parcel.writeInt(size);
                parcel.writeInt(totalPage);
                parcel.writeInt(page);
            }
        }

        public static class QuestionlistBean implements Parcelable {
            private String quesAnswer;
            private String quesTitle;
            private int countUseful;
            private int id;
            private String quesType;

            protected QuestionlistBean(Parcel in) {
                quesAnswer = in.readString();
                quesTitle = in.readString();
                countUseful = in.readInt();
                id = in.readInt();
                quesType = in.readString();
            }

            public QuestionlistBean(String quesTitle,String quesAnswer) {
                this.quesAnswer = quesAnswer;
                this.quesTitle = quesTitle;
            }

            public static final Creator<QuestionlistBean> CREATOR = new Creator<QuestionlistBean>() {
                @Override
                public QuestionlistBean createFromParcel(Parcel in) {
                    return new QuestionlistBean(in);
                }

                @Override
                public QuestionlistBean[] newArray(int size) {
                    return new QuestionlistBean[size];
                }
            };

            public String getQuesAnswer() {
                return quesAnswer;
            }

            public void setQuesAnswer(String quesAnswer) {
                this.quesAnswer = quesAnswer;
            }

            public String getQuesTitle() {
                return quesTitle;
            }

            public void setQuesTitle(String quesTitle) {
                this.quesTitle = quesTitle;
            }

            public int getCountUseful() {
                return countUseful;
            }

            public void setCountUseful(int countUseful) {
                this.countUseful = countUseful;
            }

            public int getId() {
                return id;
            }

            public void setId(int id) {
                this.id = id;
            }

            public String getQuesType() {
                return quesType;
            }

            public void setQuesType(String quesType) {
                this.quesType = quesType;
            }

            @Override
            public int describeContents() {
                return 0;
            }

            @Override
            public void writeToParcel(Parcel parcel, int i) {
                parcel.writeString(quesAnswer);
                parcel.writeString(quesTitle);
                parcel.writeInt(countUseful);
                parcel.writeInt(id);
                parcel.writeString(quesType);
            }
        }
    }
}
